Repository navigation
Upgrade to Neovim 0.12 and nvim-treesitter main - #15
Merged
Merged
Conversation
nvim-treesitter's master branch doesn't support Neovim 0.12, so move to
the main rewrite:
- treesitter.lua only installs parsers; a FileType autocmd starts
Neovim's built-in highlighting and nvim-treesitter's indentexpr.
- Incremental selection maps (<C-space>, <bs>) now use 0.12's built-in
`an`/`in`. nvim-ts-autotag gets its own setup() instead of the removed
configs module.
- Parsers are compiled with the tree-sitter CLI, which Mason installs;
parsers install again once Mason finishes on a fresh machine.
- lazy_init.lua creates stdpath("data")/site before lazy.nvim sets the
runtimepath. Neovim drops it from the runtimepath if it's missing, so
parsers installed there on a fresh machine didn't load until a restart.
- neotest-golang v2, which needs treesitter main.
- All plugins updated to their latest commits under 0.12.
CI installs Neovim 0.12.6 and a pinned tree-sitter CLI. The smoke test
waits for every parser to install and checks that go, tsx and lua
buffers get treesitter highlighting.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 90315f97-7c82-4bc1-9bf1-2f8460782554
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the config to Neovim 0.12 (CI: 0.12.6), which also unblocks rustaceanvim v9 for Rust support in a follow-up PR.
nvim-treesitter's
masterbranch doesn't support 0.12, so this migrates to itsmainrewrite:lazy/treesitter.lua: only installs parsers. AFileTypeautocmd starts Neovim's built-in highlighting (and nvim-treesitter's experimentalindentexpr, as before) wherever a parser exists.<C-space>/<bs>now drive 0.12's built-inan/in. Checked headlessly:bar→(bar, baz)→foo(bar, baz)→ back.setup(), sincenvim-treesitter.configsis gone.tree-sitter-cli), and parsers install once Mason finishes on a fresh machine.lazy_init.luacreatesstdpath("data")/sitebefore lazy.nvim sets the runtimepath. Neovim drops that entry if the directory doesn't exist, so on a fresh machine parsers installed there didn't load until a restart. Found by the smoke test.main) and all plugins updated to their latest commits.CI:
setup-nviminstalls Neovim 0.12.6 and tree-sitter CLI 0.27.1. The smoke test now waits for every parser to install and checks Go/TSX/Lua buffers get treesitter highlighting.Tested locally on 0.12.6: fresh smoke run passes in ~60s, including compiling all 25 parsers with gcc;
:checkhealth vim.deprecatedreports nothing; all parsers show in:checkhealth nvim-treesitter.To use it locally after merging:
choco uninstall neovim(admin) sonvimresolves to the winget 0.12.6 install.%LOCALAPPDATA%\nvim-data\lazy\nvim-treesitter(it has oldmasterparsers in it), then pull and start Neovim. I can do this step.